package com.kede.pay.domain;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.math.BigDecimal;

import lombok.Data;

/**
 * 批次转账表
 * @TableName sy_transfer_batch_log
 */
@TableName(value ="sy_transfer_batch_log")
@Data
public class TransferBatchLog implements Serializable {
    /**
     * 商户系统内部的商家批次单号，在商户系统内部唯一
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 商家批次单号
     */
    @TableField(value = "out_batch_no")
    private String outBatchNo;

    /**
     * 批次名称
     */
    @TableField(value = "batch_name")
    private String batchName;

    /**
     * 批次备注
     */
    @TableField(value = "batch_remark")
    private String batchRemark;

    /**
     * 转账总金额
     */
    @TableField(value = "total_amount")
    private BigDecimal totalAmount;

    /**
     * 转账总笔数
     */
    @TableField(value = "total_num")
    private Integer totalNum;

    /**
     * 创建时间
     */
    @TableField(value = "createtime",fill = FieldFill.INSERT)
    private Integer createtime;

    /**
     * 更新时间
     */
    @TableField(value = "updatetime",fill = FieldFill.INSERT_UPDATE)
    private Integer updatetime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TransferBatchLog other = (TransferBatchLog) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getOutBatchNo() == null ? other.getOutBatchNo() == null : this.getOutBatchNo().equals(other.getOutBatchNo()))
            && (this.getBatchName() == null ? other.getBatchName() == null : this.getBatchName().equals(other.getBatchName()))
            && (this.getBatchRemark() == null ? other.getBatchRemark() == null : this.getBatchRemark().equals(other.getBatchRemark()))
            && (this.getTotalAmount() == null ? other.getTotalAmount() == null : this.getTotalAmount().equals(other.getTotalAmount()))
            && (this.getTotalNum() == null ? other.getTotalNum() == null : this.getTotalNum().equals(other.getTotalNum()))
            && (this.getCreatetime() == null ? other.getCreatetime() == null : this.getCreatetime().equals(other.getCreatetime()))
            && (this.getUpdatetime() == null ? other.getUpdatetime() == null : this.getUpdatetime().equals(other.getUpdatetime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getOutBatchNo() == null) ? 0 : getOutBatchNo().hashCode());
        result = prime * result + ((getBatchName() == null) ? 0 : getBatchName().hashCode());
        result = prime * result + ((getBatchRemark() == null) ? 0 : getBatchRemark().hashCode());
        result = prime * result + ((getTotalAmount() == null) ? 0 : getTotalAmount().hashCode());
        result = prime * result + ((getTotalNum() == null) ? 0 : getTotalNum().hashCode());
        result = prime * result + ((getCreatetime() == null) ? 0 : getCreatetime().hashCode());
        result = prime * result + ((getUpdatetime() == null) ? 0 : getUpdatetime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", outBatchNo=").append(outBatchNo);
        sb.append(", batchName=").append(batchName);
        sb.append(", batchRemark=").append(batchRemark);
        sb.append(", totalAmount=").append(totalAmount);
        sb.append(", totalNum=").append(totalNum);
        sb.append(", createtime=").append(createtime);
        sb.append(", updatetime=").append(updatetime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}